home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / win-fort.zip / DRAWMINU.FOR < prev    next >
Text File  |  1991-11-09  |  2KB  |  67 lines

  1. $DEFINE GDI
  2. $DEFINE USER
  3.       INCLUDE 'WINDOWS.FI'
  4.       SUBROUTINE DRAW_MINUTEHAND
  5.       IMPLICIT NONE
  6. C
  7. C Author       : Kevin B Black
  8. C Date written : 23-Oct-1991
  9. C Abstract     :
  10. C
  11. C DRAW MINUTE HAND
  12. C
  13. C Draws minute hand using the colour specified by the COLOUR argument. Only a
  14. C line is drawn in the iconic state, using the second hand's vectors. If solid
  15. C hands are required, in the non-iconic state, then the hands area is flood
  16. C filled with the Polygon function.
  17. C
  18. C Variables
  19. C
  20.       REAL MHAND(2,6)              ! Minute hand vector description
  21.       REAL COSA,SINA               ! Cosine and Sine of minute hand angle
  22.       INTEGER I                    ! Work integer
  23.       INCLUDE 'WINDOWS.FD'         ! Windows functions and parameters
  24.       RECORD /POINT/ MHANDV(6)     ! Minute hand device vectors
  25.       INCLUDE 'FWCLOCK.FD'         ! Include FWLCOCK variables and parameters
  26.       DATA MHAND/-0.025,  0.00,    ! Minute hand outline vectors
  27.      *           -0.030,  0.60,
  28.      *            0.00,   0.665,
  29.      *            0.030,  0.60,
  30.      *            0.025,  0.00,
  31.      *           -0.025,  0.00/
  32. C
  33. C Depends if window is open or iconic
  34. C
  35.       IF(IMANICON)THEN
  36. C
  37. C In the iconic state only a line is required, the pen and ROP2 mode should
  38. C already have been selected.
  39. C
  40.          WSTATUS=MoveTo(FWCPS.HDC,AXC,AYC)
  41.          WSTATUS=LineTo(FWCPS.HDC,MHAND2(OMINS).X,MHAND2(OMINS).Y)
  42.       ELSE
  43. C
  44. C In the open window state the minute hand outline must be rotated to the
  45. C correct angle. It is then drawn using the Polyline or filled in with the
  46. C Polygon function, if solid hands have been chosen by the user.
  47. C
  48.          COSA=COS(PI-FLOAT(OMINS)*ZINC)
  49.          SINA=SIN(PI-FLOAT(OMINS)*ZINC)
  50.          DO I=1,6
  51.             MHANDV(I).X=AXC+FLOAT(RADIUS*MHAND(1,I))*COSA+
  52.      *                      FLOAT(RADIUS*MHAND(2,I))*SINA
  53.             MHANDV(I).Y=AYC-FLOAT(RADIUS*MHAND(1,I))*SINA+
  54.      *                      FLOAT(RADIUS*MHAND(2,I))*COSA
  55.          ENDDO
  56.          IF(SOLIDHANDS)THEN
  57.             WSTATUS=Polygon(FWCPS.HDC,MHANDV,6)
  58.          ELSE
  59.             WSTATUS=Polyline(FWCPS.HDC,MHANDV,6)
  60. c         IF(SOLIDHANDS)WSTATUS=FloodFill(FWCPS.HDC,
  61. c     *                               AXC+FLOAT(RADIUS)*0.6*SINA,
  62. c     *                               AYC+FLOAT(RADIUS)*0.6*COSA,COLOUR)
  63.          ENDIF
  64.       ENDIF
  65.       RETURN
  66.       END
  67.